import axios from "axios";
export let getlist = ()=>{
    return (dispatch)=>{
        axios.get("/api/list").then(res=>{
            dispatch({
                type:"getlist",
                payload:res.data
            })
        })
    }
}
export let addshop = (item)=>{
    return {
        type:"addshop",
        payload:item
    }
}
export let addFn = (id)=>{
    return {
        type:"addFn",
        payload:id
    }
}
export let delFn = (ID)=>{
    return {
        type:"delFn",
        payload:ID
    }
}
export let checkitem = (id)=>{
    return {
        type:"checkitem",
        payload:id
    }
}
export let changeall =()=>{ // 全选不需要传递id
    return {
        type:"changeall"
    }
}
export let addaddressfn = (values)=>{
    return {
        type:"addaddressfn",
        payload:values
    }
}
export let  delFn1= (index)=>{
    return {
        type:"delFn1",
        payload:index
    } 
}
export let editaddressfn =(item,index)=>{
    return {
        type:"editaddressfn",
        payload:item,
        payload1:index
    }
}
export let getpulllist = (data)=>{
    return (dispatch)=>{
        axios.get("/api/list").then(res=>{
            dispatch({
                type:"getpulllist",
                payload:res.data,
                payload1:data
            })
        })
    }
}